﻿// <copyright file="DTWizard.cs" company="Microsoft Corporation">
// Copyright (c) 2009 Microsoft Corporation All Rights Reserved
// </copyright>
// <author>Michael S. Scherotter</author>
// <email>mischero@microsoft.com</email>
// <date>2010-01-20</date>
// <summary>DTWizard class definition</summary>

namespace WebAnalyticsServiceWizard
{
    using System.Diagnostics.CodeAnalysis;
    using System.Runtime.InteropServices;
    using EnvDTE;

    /// <summary>
    /// Developer Environment Wizard
    /// </summary>
    [ComVisible(true)]
    public class DTWizard : IDTWizard
    {
        #region IDTWizard Members

        /// <summary>
        /// Modify the App.xaml to add the WebAnalyticsService to the ApplicationLifetimeObjects
        /// </summary>
        /// <param name="application">the Visual Studio Application</param>
        /// <param name="hwndOwner">the window</param>
        /// <param name="contextParams">the context parameters</param>
        /// <param name="customParams">the custom parameters</param>
        /// <param name="retval">the return value</param>
        [SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "3#", Justification = "Conflicts with StyleCop"),
        SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "2#", Justification = "Conflicts with StyleCop"), 
        SuppressMessage("Microsoft.Naming", "CA1725:ParameterNamesShouldMatchBaseDeclaration", MessageId = "0#", Justification = "Conflicts with StyleCop")]
        public void Execute(object application, int hwndOwner, ref object[] contextParams, ref object[] customParams, ref wizardResult retval)
        {
            if (contextParams != null && contextParams.Length > 0)
            {
                var projectName = contextParams[1] as string;

                AppXamlUpdater.ModifyAppXaml(application, projectName);

                retval = wizardResult.wizardResultSuccess;
            }
        }

        #endregion
    }
}
